// index.js
import parse, { renderMathInText } from "@rojer/katex-mini";

Page({
  data: {
    // ref: https://rojer95.github.io/dslate/getting-started/math
    dslate: [
      {
        type: "node",
        name: "div",
        children: [
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: "如图所示，倾角为",
              },
            ],
          },
          {
            type: "node",
            name: "span",
            children: [
              {
                name: "span",
                attrs: {
                  class: "katex katex-span",
                  style: "",
                },
                children: [
                  {
                    name: "span",
                    attrs: {
                      class: "katex-html katex-span",
                      style: "",
                    },
                    children: [
                      {
                        name: "span",
                        attrs: {
                          class: "base katex-span",
                          style: "",
                        },
                        children: [
                          {
                            name: "span",
                            attrs: {
                              class: "strut katex-span",
                              style: "height:0.6944em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord mathnormal",
                              style: "margin-right:0.02778em;",
                            },
                            children: [
                              {
                                type: "text",
                                text: "θ",
                              },
                            ],
                          },
                        ],
                      },
                    ],
                  },
                ],
              },
            ],
          },
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: "的周定斜面顶端安装有定滑轮，轻绳跨过滑轮两端分别连接物体",
              },
            ],
          },
          {
            type: "node",
            name: "span",
            children: [
              {
                name: "span",
                attrs: {
                  class: "katex katex-span",
                  style: "",
                },
                children: [
                  {
                    name: "span",
                    attrs: {
                      class: "katex-html katex-span",
                      style: "",
                    },
                    children: [
                      {
                        name: "span",
                        attrs: {
                          class: "base katex-span",
                          style: "",
                        },
                        children: [
                          {
                            name: "span",
                            attrs: {
                              class: "strut katex-span",
                              style: "height:0.6833em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord mathnormal",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: "A",
                              },
                            ],
                          },
                        ],
                      },
                    ],
                  },
                ],
              },
            ],
          },
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: "、",
              },
            ],
          },
          {
            type: "node",
            name: "span",
            children: [
              {
                name: "span",
                attrs: {
                  class: "katex katex-span",
                  style: "",
                },
                children: [
                  {
                    name: "span",
                    attrs: {
                      class: "katex-html katex-span",
                      style: "",
                    },
                    children: [
                      {
                        name: "span",
                        attrs: {
                          class: "base katex-span",
                          style: "",
                        },
                        children: [
                          {
                            name: "span",
                            attrs: {
                              class: "strut katex-span",
                              style: "height:0.6833em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord mathnormal",
                              style: "margin-right:0.05017em;",
                            },
                            children: [
                              {
                                type: "text",
                                text: "B",
                              },
                            ],
                          },
                        ],
                      },
                    ],
                  },
                ],
              },
            ],
          },
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: ",轻绵与斜面平行，整个系统始终处于静止状态。不计滑轮的摩擦。已知物体",
              },
            ],
          },
          {
            type: "node",
            name: "span",
            children: [
              {
                name: "span",
                attrs: {
                  class: "katex katex-span",
                  style: "",
                },
                children: [
                  {
                    name: "span",
                    attrs: {
                      class: "katex-html katex-span",
                      style: "",
                    },
                    children: [
                      {
                        name: "span",
                        attrs: {
                          class: "base katex-span",
                          style: "",
                        },
                        children: [
                          {
                            name: "span",
                            attrs: {
                              class: "strut katex-span",
                              style: "height:0.6833em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord mathnormal",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: "A",
                              },
                            ],
                          },
                        ],
                      },
                    ],
                  },
                ],
              },
            ],
          },
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: " 的质量为",
              },
            ],
          },
          {
            type: "node",
            name: "span",
            children: [
              {
                name: "span",
                attrs: {
                  class: "katex katex-span",
                  style: "",
                },
                children: [
                  {
                    name: "span",
                    attrs: {
                      class: "katex-html katex-span",
                      style: "",
                    },
                    children: [
                      {
                        name: "span",
                        attrs: {
                          class: "base katex-span",
                          style: "",
                        },
                        children: [
                          {
                            name: "span",
                            attrs: {
                              class: "strut katex-span",
                              style: "height:0.6444em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord mathnormal",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: "m",
                              },
                            ],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: "1",
                              },
                            ],
                          },
                        ],
                      },
                    ],
                  },
                ],
              },
            ],
          },
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: "，物体 ",
              },
            ],
          },
          {
            type: "node",
            name: "span",
            children: [
              {
                name: "span",
                attrs: {
                  class: "katex katex-span",
                  style: "",
                },
                children: [
                  {
                    name: "span",
                    attrs: {
                      class: "katex-html katex-span",
                      style: "",
                    },
                    children: [
                      {
                        name: "span",
                        attrs: {
                          class: "base katex-span",
                          style: "",
                        },
                        children: [
                          {
                            name: "span",
                            attrs: {
                              class: "strut katex-span",
                              style: "height:0.6833em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord mathnormal",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: "A",
                              },
                            ],
                          },
                        ],
                      },
                    ],
                  },
                ],
              },
            ],
          },
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: " 与斜面间的动摩擦因数为 ",
              },
            ],
          },
          {
            type: "node",
            name: "span",
            children: [
              {
                name: "span",
                attrs: {
                  class: "katex katex-span",
                  style: "",
                },
                children: [
                  {
                    name: "span",
                    attrs: {
                      class: "katex-html katex-span",
                      style: "",
                    },
                    children: [
                      {
                        name: "span",
                        attrs: {
                          class: "base katex-span",
                          style: "",
                        },
                        children: [
                          {
                            name: "span",
                            attrs: {
                              class: "strut katex-span",
                              style: "height:1em;vertical-align:-0.25em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord mathnormal",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: "μ",
                              },
                            ],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mopen",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: "(",
                              },
                            ],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord mathnormal",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: "μ",
                              },
                            ],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mspace katex-span",
                              style: "margin-right:0.2778em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mrel",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: "&lt;",
                              },
                            ],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mspace katex-span",
                              style: "margin-right:0.2778em;",
                            },
                            children: [],
                          },
                        ],
                      },
                      {
                        name: "span",
                        attrs: {
                          class: "base katex-span",
                          style: "",
                        },
                        children: [
                          {
                            name: "span",
                            attrs: {
                              class: "strut katex-span",
                              style:
                                "height:0.7335em;vertical-align:-0.0391em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord mathnormal",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: "t",
                              },
                            ],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord mathnormal",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: "an",
                              },
                            ],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord mathnormal",
                              style: "margin-right:0.02778em;",
                            },
                            children: [
                              {
                                type: "text",
                                text: "θ",
                              },
                            ],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mspace katex-span",
                              style: "margin-right:0.2778em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mrel",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: "&lt;",
                              },
                            ],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mspace katex-span",
                              style: "margin-right:0.2778em;",
                            },
                            children: [],
                          },
                        ],
                      },
                      {
                        name: "span",
                        attrs: {
                          class: "base katex-span",
                          style: "",
                        },
                        children: [
                          {
                            name: "span",
                            attrs: {
                              class: "strut katex-span",
                              style: "height:1em;vertical-align:-0.25em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: "1",
                              },
                            ],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mclose",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: ")",
                              },
                            ],
                          },
                        ],
                      },
                    ],
                  },
                ],
              },
            ],
          },
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: "，设最大静摩擦力等于滑动摩擦力，重力加速度大小为",
              },
            ],
          },
          {
            type: "node",
            name: "span",
            children: [
              {
                name: "span",
                attrs: {
                  class: "katex katex-span",
                  style: "",
                },
                children: [
                  {
                    name: "span",
                    attrs: {
                      class: "katex-html katex-span",
                      style: "",
                    },
                    children: [
                      {
                        name: "span",
                        attrs: {
                          class: "base katex-span",
                          style: "",
                        },
                        children: [
                          {
                            name: "span",
                            attrs: {
                              class: "strut katex-span",
                              style: "height:0.625em;vertical-align:-0.1944em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord mathnormal",
                              style: "margin-right:0.03588em;",
                            },
                            children: [
                              {
                                type: "text",
                                text: "g",
                              },
                            ],
                          },
                        ],
                      },
                    ],
                  },
                ],
              },
            ],
          },
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: "。求：",
              },
            ],
          },
        ],
      },
      {
        type: "node",
        name: "div",
        children: [
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: "（1）斜面对物体 ",
              },
            ],
          },
          {
            type: "node",
            name: "span",
            children: [
              {
                name: "span",
                attrs: {
                  class: "katex katex-span",
                  style: "",
                },
                children: [
                  {
                    name: "span",
                    attrs: {
                      class: "katex-html katex-span",
                      style: "",
                    },
                    children: [
                      {
                        name: "span",
                        attrs: {
                          class: "base katex-span",
                          style: "",
                        },
                        children: [
                          {
                            name: "span",
                            attrs: {
                              class: "strut katex-span",
                              style: "height:0.6833em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord mathnormal",
                              style: "",
                            },
                            children: [
                              {
                                type: "text",
                                text: "A",
                              },
                            ],
                          },
                        ],
                      },
                    ],
                  },
                ],
              },
            ],
          },
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: " 的支持力大小 ",
              },
            ],
          },
          {
            type: "node",
            name: "span",
            children: [
              {
                name: "span",
                attrs: {
                  class: "katex katex-span",
                  style: "",
                },
                children: [
                  {
                    name: "span",
                    attrs: {
                      class: "katex-html katex-span",
                      style: "",
                    },
                    children: [
                      {
                        name: "span",
                        attrs: {
                          class: "base katex-span",
                          style: "",
                        },
                        children: [
                          {
                            name: "span",
                            attrs: {
                              class: "strut katex-span",
                              style: "height:0.8333em;vertical-align:-0.15em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord katex-span",
                              style: "",
                            },
                            children: [
                              {
                                name: "span",
                                attrs: {
                                  class: "mord mathnormal",
                                  style: "margin-right:0.13889em;",
                                },
                                children: [
                                  {
                                    type: "text",
                                    text: "F",
                                  },
                                ],
                              },
                              {
                                name: "span",
                                attrs: {
                                  class: "msupsub katex-span",
                                  style: "",
                                },
                                children: [
                                  {
                                    name: "span",
                                    attrs: {
                                      class: "vlist-t vlist-t2 katex-span",
                                      style: "",
                                    },
                                    children: [
                                      {
                                        name: "span",
                                        attrs: {
                                          class: "vlist-r katex-span",
                                          style: "",
                                        },
                                        children: [
                                          {
                                            name: "span",
                                            attrs: {
                                              class: "vlist katex-span",
                                              style: "height:0.3283em;",
                                            },
                                            children: [
                                              {
                                                name: "span",
                                                attrs: {
                                                  class: " katex-span",
                                                  style:
                                                    "top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;",
                                                },
                                                children: [
                                                  {
                                                    name: "span",
                                                    attrs: {
                                                      class:
                                                        "pstrut katex-span",
                                                      style: "height:2.7em;",
                                                    },
                                                    children: [],
                                                  },
                                                  {
                                                    name: "span",
                                                    attrs: {
                                                      class:
                                                        "sizing reset-size6 size3 mtight katex-span",
                                                      style: "",
                                                    },
                                                    children: [
                                                      {
                                                        name: "span",
                                                        attrs: {
                                                          class:
                                                            "mord mathnormal mtight",
                                                          style:
                                                            "margin-right:0.10903em;",
                                                        },
                                                        children: [
                                                          {
                                                            type: "text",
                                                            text: "N",
                                                          },
                                                        ],
                                                      },
                                                    ],
                                                  },
                                                ],
                                              },
                                            ],
                                          },
                                          {
                                            name: "span",
                                            attrs: {
                                              class: "vlist-s katex-span",
                                              style: "",
                                            },
                                            children: [
                                              {
                                                type: "text",
                                                text: "​",
                                              },
                                            ],
                                          },
                                        ],
                                      },
                                      {
                                        name: "span",
                                        attrs: {
                                          class: "vlist-r katex-span",
                                          style: "",
                                        },
                                        children: [
                                          {
                                            name: "span",
                                            attrs: {
                                              class: "vlist katex-span",
                                              style: "height:0.15em;",
                                            },
                                            children: [
                                              {
                                                name: "span",
                                                attrs: {
                                                  class: " katex-span",
                                                  style: "",
                                                },
                                                children: [],
                                              },
                                            ],
                                          },
                                        ],
                                      },
                                    ],
                                  },
                                ],
                              },
                            ],
                          },
                        ],
                      },
                    ],
                  },
                ],
              },
            ],
          },
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: "；",
              },
            ],
          },
        ],
      },
      {
        type: "node",
        name: "div",
        children: [
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: "（2）物休 ",
              },
            ],
          },
          {
            type: "node",
            name: "span",
            children: [
              {
                name: "span",
                attrs: {
                  class: "katex katex-span",
                  style: "",
                },
                children: [
                  {
                    name: "span",
                    attrs: {
                      class: "katex-html katex-span",
                      style: "",
                    },
                    children: [
                      {
                        name: "span",
                        attrs: {
                          class: "base katex-span",
                          style: "",
                        },
                        children: [
                          {
                            name: "span",
                            attrs: {
                              class: "strut katex-span",
                              style: "height:0.6833em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord mathnormal",
                              style: "margin-right:0.05017em;",
                            },
                            children: [
                              {
                                type: "text",
                                text: "B",
                              },
                            ],
                          },
                        ],
                      },
                    ],
                  },
                ],
              },
            ],
          },
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: " 的质量 ",
              },
            ],
          },
          {
            type: "node",
            name: "span",
            children: [
              {
                name: "span",
                attrs: {
                  class: "katex katex-span",
                  style: "",
                },
                children: [
                  {
                    name: "span",
                    attrs: {
                      class: "katex-html katex-span",
                      style: "",
                    },
                    children: [
                      {
                        name: "span",
                        attrs: {
                          class: "base katex-span",
                          style: "",
                        },
                        children: [
                          {
                            name: "span",
                            attrs: {
                              class: "strut katex-span",
                              style: "height:0.5806em;vertical-align:-0.15em;",
                            },
                            children: [],
                          },
                          {
                            name: "span",
                            attrs: {
                              class: "mord katex-span",
                              style: "",
                            },
                            children: [
                              {
                                name: "span",
                                attrs: {
                                  class: "mord mathnormal",
                                  style: "",
                                },
                                children: [
                                  {
                                    type: "text",
                                    text: "m",
                                  },
                                ],
                              },
                              {
                                name: "span",
                                attrs: {
                                  class: "msupsub katex-span",
                                  style: "",
                                },
                                children: [
                                  {
                                    name: "span",
                                    attrs: {
                                      class: "vlist-t vlist-t2 katex-span",
                                      style: "",
                                    },
                                    children: [
                                      {
                                        name: "span",
                                        attrs: {
                                          class: "vlist-r katex-span",
                                          style: "",
                                        },
                                        children: [
                                          {
                                            name: "span",
                                            attrs: {
                                              class: "vlist katex-span",
                                              style: "height:0.3283em;",
                                            },
                                            children: [
                                              {
                                                name: "span",
                                                attrs: {
                                                  class: " katex-span",
                                                  style:
                                                    "top:-2.55em;margin-left:0em;margin-right:0.05em;",
                                                },
                                                children: [
                                                  {
                                                    name: "span",
                                                    attrs: {
                                                      class:
                                                        "pstrut katex-span",
                                                      style: "height:2.7em;",
                                                    },
                                                    children: [],
                                                  },
                                                  {
                                                    name: "span",
                                                    attrs: {
                                                      class:
                                                        "sizing reset-size6 size3 mtight katex-span",
                                                      style: "",
                                                    },
                                                    children: [
                                                      {
                                                        name: "span",
                                                        attrs: {
                                                          class:
                                                            "mord mathnormal mtight",
                                                          style:
                                                            "margin-right:0.05017em;",
                                                        },
                                                        children: [
                                                          {
                                                            type: "text",
                                                            text: "B",
                                                          },
                                                        ],
                                                      },
                                                    ],
                                                  },
                                                ],
                                              },
                                            ],
                                          },
                                          {
                                            name: "span",
                                            attrs: {
                                              class: "vlist-s katex-span",
                                              style: "",
                                            },
                                            children: [
                                              {
                                                type: "text",
                                                text: "​",
                                              },
                                            ],
                                          },
                                        ],
                                      },
                                      {
                                        name: "span",
                                        attrs: {
                                          class: "vlist-r katex-span",
                                          style: "",
                                        },
                                        children: [
                                          {
                                            name: "span",
                                            attrs: {
                                              class: "vlist katex-span",
                                              style: "height:0.15em;",
                                            },
                                            children: [
                                              {
                                                name: "span",
                                                attrs: {
                                                  class: " katex-span",
                                                  style: "",
                                                },
                                                children: [],
                                              },
                                            ],
                                          },
                                        ],
                                      },
                                    ],
                                  },
                                ],
                              },
                            ],
                          },
                        ],
                      },
                    ],
                  },
                ],
              },
            ],
          },
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: " 的取值范围；",
              },
            ],
          },
        ],
      },
      {
        type: "node",
        name: "div",
        children: [
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: "",
              },
            ],
          },
        ],
      },
      {
        type: "node",
        name: "div",
        children: [
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: "",
              },
            ],
          },
          {
            type: "node",
            name: "img",
            attrs: {
              style:
                "width:227px;height:206px;margin-left:undefined;margin-top:undefined;margin-bottom:undefined;margin-right:undefined;",
              src: "",
            },
          },
          {
            type: "node",
            name: "span",
            attrs: {
              style: "",
            },
            children: [
              {
                type: "text",
                text: "",
              },
            ],
          },
        ],
      },
    ],
    nodes: [],
    latex: `\\begin{matrix} 0 & 1 \\\\ 1 & 0 \\end{matrix}\\quad
\\begin{pmatrix} 0 & -i \\\\ i & 0 \\end{pmatrix}\\\\
\\begin{bmatrix} 0 & -1 \\\\ 1 & 0 \\end{bmatrix}\\quad
\\begin{Bmatrix} 1 & 0 \\\\ 0 & -1 \\end{Bmatrix}\\\\
\\begin{vmatrix} a & b \\\\ c & d \\end{vmatrix}\\quad
\\begin{Vmatrix} i & 0 \\\\ 0 & -i \\end{Vmatrix}`,
    latexAutoRender:
      "这是一个行内公式 $ f(x) = sum_{n=0}^{infty} \\frac{f^{(n)}(a)}{n!} (x - a)^n $ ，这是一个行间的公式 $$ \\int_a^b f(x) , dx = F(b) - F(a) $$ \n这是新起一行的文字",
    latexAutoRenderNodes: [],
  },

  onShow() {
    this.renderLatex();
  },

  onInput: function (e) {
    this.setData({
      latex: e.detail.value,
    });
  },

  onInputAutoRender: function (e) {
    this.setData({
      latexAutoRender: e.detail.value,
    });
  },

  renderLatex: function () {
    try {
      const nodes = parse(this.data.latex, {
        throwError: true,
        displayMode: true,
      });
      this.setData({
        nodes,
      });
    } catch (error) {
      console.log(error);
      this.setData({
        nodes: [
          {
            name: "div",
            attrs: {
              style: "color: red;",
            },
            children: [
              {
                type: "text",
                text: "渲染错误",
              },
            ],
          },
        ],
      });
    }

    try {
      const autoRenderNodes = renderMathInText(this.data.latexAutoRender, {
        delimiters: [
          { left: "$$", right: "$$", display: true },
          { left: "$", right: "$", display: false },
          { left: "\\(", right: "\\)", display: false },
          {
            left: "\\begin{equation}",
            right: "\\end{equation}",
            display: true,
          },
          { left: "\\begin{align}", right: "\\end{align}", display: true },
          { left: "\\begin{alignat}", right: "\\end{alignat}", display: true },
          { left: "\\begin{gather}", right: "\\end{gather}", display: true },
          { left: "\\begin{CD}", right: "\\end{CD}", display: true },
          { left: "\\[", right: "\\]", display: true },
        ],
      });
      console.log("autoRenderNodes", autoRenderNodes);

      this.setData({
        latexAutoRenderNodes: autoRenderNodes,
      });
    } catch (error) {}
  },
});
